home *** CD-ROM | disk | FTP | other *** search
- Path: news.ichange.com!newsmaster
- From: Jesse Liberty <jl@staff.ichange.com>
- Newsgroups: comp.lang.c++
- Subject: Re: Derivation and calling virtual functions
- Date: Sat, 30 Mar 1996 13:18:08 -0500
- Organization: AT&T New Media Services
- Message-ID: <315D7AE0.2BFF@staff.ichange.com>
- References: <graphix.828032689@spiff.cc.iastate.edu> <4jeulg$n9v@crc-news.doc.ca>
- NNTP-Posting-Host: 198.112.128.214
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win95; I)
-
- Slobodan Celenkovic wrote:
- >
- > Don't you need virtual keywords in Derived as well?
-
- If you mean this:
-
- class Animal
- {
- public:
- virtual void SomeFunc(int value);
- };
-
- class Dog : public Animal
- {
- void SomeFunc(int value);
- };
-
- no, SomeFunc in the derived class does NOT need the virtual keyword,
- though I would use it to avoid confusion. -j
-
-
- --
- Jesse Liberty. (AT&T New Media Services) jl@staff.ichange.com
- Teach Yourself C++ In 21 Days. SAMS, 1994
- Teach Yourself MORE C++ In 21 Days. SAMS, 1996
- Teach Yourself ANSI C++ In 21 Days. SAMS, 1996
- C++: An Introduction To Programming. QUE, 1996
-